
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/physics/vector/api/classes.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:31 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Essential Classes &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
    <script src="../../../../_static/jquery.js"></script>
    <script src="../../../../_static/underscore.js"></script>
    <script src="../../../../_static/doctools.js"></script>
    <script src="../../../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../../../_static/sympy-notailtext-favicon.ico"/>
    <link href="classes.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../../../genindex.html" />
    <link rel="search" title="Search" href="../../../../search.html" />
    <link rel="next" title="Kinematics (Docstrings)" href="kinematics.html" />
    <link rel="prev" title="Scalar and Vector Field Functionality" href="../fields.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="kinematics.html" title="Kinematics (Docstrings)"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../fields.html" title="Scalar and Vector Field Functionality"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="../index.html" accesskey="U">The Physics Vector Module</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Essential Classes</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="essential-classes">
<h1>Essential Classes<a class="headerlink" href="#essential-classes" title="Permalink to this headline">¶</a></h1>
<section id="coordinatesym">
<h2>CoordinateSym<a class="headerlink" href="#coordinatesym" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.CoordinateSym">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.frame.</span></span><span class="sig-name descname"><span class="pre">CoordinateSym</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">index</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L12-L78"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.CoordinateSym" title="Permalink to this definition">¶</a></dt>
<dd><p>A coordinate symbol/base scalar associated wrt a Reference Frame.</p>
<p>Ideally, users should not instantiate this class. Instances of
this class must only be accessed through the corresponding frame
as ‘frame[index]’.</p>
<p>CoordinateSyms having the same frame and index parameters are equal
(even though they may be instantiated separately).</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> : string</p>
<blockquote>
<div><p>The display name of the CoordinateSym</p>
</div></blockquote>
<p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The reference frame this base scalar belongs to</p>
</div></blockquote>
<p><strong>index</strong> : 0, 1 or 2</p>
<blockquote>
<div><p>The index of the dimension denoted by this coordinate variable</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">CoordinateSym</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
<span class="go">A_y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="go">&lt;class &#39;sympy.physics.vector.frame.CoordinateSym&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a_y</span> <span class="o">=</span> <span class="n">CoordinateSym</span><span class="p">(</span><span class="s1">&#39;a_y&#39;</span><span class="p">,</span> <span class="n">A</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a_y</span> <span class="o">==</span> <span class="n">A</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="referenceframe">
<h2>ReferenceFrame<a class="headerlink" href="#referenceframe" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.frame.</span></span><span class="sig-name descname"><span class="pre">ReferenceFrame</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indices</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">latexs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variables</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L81-L1430"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame" title="Permalink to this definition">¶</a></dt>
<dd><p>A reference frame in classical mechanics.</p>
<p>ReferenceFrame is a class used to represent a reference frame in classical
mechanics. It has a standard basis of three unit vectors in the frame’s
x, y, and z directions.</p>
<p>It also can have a rotation relative to a parent frame; this rotation is
defined by a direction cosine matrix relating this frame’s basis vectors to
the parent frame’s basis vectors.  It can also have an angular velocity
vector, defined in another frame.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.ang_acc_in">
<span class="sig-name descname"><span class="pre">ang_acc_in</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">otherframe</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L379-L410"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.ang_acc_in" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the angular acceleration Vector of the ReferenceFrame.</p>
<p>Effectively returns the Vector:
^N alpha ^B
which represent the angular acceleration of B in N, where B is self, and
N is otherframe.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>otherframe</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The ReferenceFrame which the angular acceleration is returned in.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">V</span> <span class="o">=</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">set_ang_acc</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">V</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">ang_acc_in</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">10*N.x</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.ang_vel_in">
<span class="sig-name descname"><span class="pre">ang_vel_in</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">otherframe</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L412-L446"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.ang_vel_in" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the angular velocity Vector of the ReferenceFrame.</p>
<p>Effectively returns the Vector:</p>
<p>^N omega ^B</p>
<p>which represent the angular velocity of B in N, where B is self, and
N is otherframe.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>otherframe</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The ReferenceFrame which the angular velocity is returned in.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">V</span> <span class="o">=</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">set_ang_vel</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">V</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">10*N.x</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.dcm">
<span class="sig-name descname"><span class="pre">dcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">otherframe</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L448-L531"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.dcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the direction cosine matrix relative to the provided
reference frame.</p>
<p>The returned matrix can be used to express the orthogonal unit vectors
of this frame in terms of the orthogonal unit vectors of
<code class="docutils literal notranslate"><span class="pre">otherframe</span></code>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>otherframe</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The reference frame which the direction cosine matrix of this frame
is formed relative to.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>The following example rotates the reference frame A relative to N by a
simple rotation and then calculates the direction cosine matrix of N
relative to A.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">sin</span><span class="p">,</span> <span class="n">cos</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">(</span><span class="n">q1</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,       0,        0],</span>
<span class="go">[0, cos(q1), -sin(q1)],</span>
<span class="go">[0, sin(q1),  cos(q1)]])</span>
</pre></div>
</div>
<p>The second row of the above direction cosine matrix represents the
<code class="docutils literal notranslate"><span class="pre">N.y</span></code> unit vector in N expressed in A. Like so:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ny</span> <span class="o">=</span> <span class="mi">0</span><span class="o">*</span><span class="n">A</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">cos</span><span class="p">(</span><span class="n">q1</span><span class="p">)</span><span class="o">*</span><span class="n">A</span><span class="o">.</span><span class="n">y</span> <span class="o">-</span> <span class="n">sin</span><span class="p">(</span><span class="n">q1</span><span class="p">)</span><span class="o">*</span><span class="n">A</span><span class="o">.</span><span class="n">z</span>
</pre></div>
</div>
<p>Thus, expressing <code class="docutils literal notranslate"><span class="pre">N.y</span></code> in A should return the same result:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="o">.</span><span class="n">express</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
<span class="go">cos(q1)*A.y - sin(q1)*A.z</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>It is import to know what form of the direction cosine matrix is
returned. If <code class="docutils literal notranslate"><span class="pre">B.dcm(A)</span></code> is called, it means the “direction cosine
matrix of B relative to A”. This is the matrix <span class="math notranslate nohighlight">\(^{\mathbf{A}} \mathbf{R} ^{\mathbf{B}}\)</span>
shown in the following relationship:</p>
<div class="math notranslate nohighlight">
\[\begin{split}\begin{bmatrix}
  \hat{\mathbf{b}}_1 \\
  \hat{\mathbf{b}}_2 \\
  \hat{\mathbf{b}}_3
\end{bmatrix}
=
{}^A\mathbf{R}^B
\begin{bmatrix}
  \hat{\mathbf{a}}_1 \\
  \hat{\mathbf{a}}_2 \\
  \hat{\mathbf{a}}_3
\end{bmatrix}.\end{split}\]</div>
<p><span class="math notranslate nohighlight">\({}^A\mathbf{R}^B\)</span> is the matrix that expresses the B unit
vectors in terms of the A unit vectors.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.orient">
<span class="sig-name descname"><span class="pre">orient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rot_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">amounts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rot_order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L1113-L1191"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.orient" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the orientation of this reference frame relative to another
(parent) reference frame.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>It is now recommended to use the <code class="docutils literal notranslate"><span class="pre">.orient_axis,</span>
<span class="pre">.orient_body_fixed,</span> <span class="pre">.orient_space_fixed,</span> <span class="pre">.orient_quaternion</span></code>
methods for the different rotation types.</p>
</div>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>parent</strong> : ReferenceFrame</p>
<blockquote>
<div><p>Reference frame that this reference frame will be rotated relative
to.</p>
</div></blockquote>
<p><strong>rot_type</strong> : str</p>
<blockquote>
<div><p>The method used to generate the direction cosine matrix. Supported
methods are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">'Axis'</span></code>: simple rotations about a single common axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'DCM'</span></code>: for setting the direction cosine matrix directly</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Body'</span></code>: three successive rotations about new intermediate
axes, also called “Euler and Tait-Bryan angles”</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Space'</span></code>: three successive rotations about the parent
frames’ unit vectors</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Quaternion'</span></code>: rotations defined by four parameters which
result in a singularity free direction cosine matrix</p></li>
</ul>
</div></blockquote>
<p><strong>amounts :</strong></p>
<blockquote>
<div><p>Expressions defining the rotation angles or direction cosine
matrix. These must match the <code class="docutils literal notranslate"><span class="pre">rot_type</span></code>. See examples below for
details. The input types are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">'Axis'</span></code>: 2-tuple (expr/sym/func, Vector)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'DCM'</span></code>: Matrix, shape(3,3)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Body'</span></code>: 3-tuple of expressions, symbols, or functions</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Space'</span></code>: 3-tuple of expressions, symbols, or functions</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Quaternion'</span></code>: 4-tuple of expressions, symbols, or
functions</p></li>
</ul>
</div></blockquote>
<p><strong>rot_order</strong> : str or int, optional</p>
<blockquote>
<div><p>If applicable, the order of the successive of rotations. The string
<code class="docutils literal notranslate"><span class="pre">'123'</span></code> and integer <code class="docutils literal notranslate"><span class="pre">123</span></code> are equivalent, for example. Required
for <code class="docutils literal notranslate"><span class="pre">'Body'</span></code> and <code class="docutils literal notranslate"><span class="pre">'Space'</span></code>.</p>
</div></blockquote>
</dd>
<dt class="field-even">Warns</dt>
<dd class="field-even"><p><strong>UserWarning</strong></p>
<blockquote>
<div><p>If the orientation creates a kinematic loop.</p>
</div></blockquote>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.orient_axis">
<span class="sig-name descname"><span class="pre">orient_axis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">axis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">angle</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L585-L674"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.orient_axis" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the orientation of this reference frame with respect to a
parent reference frame by rotating through an angle about an axis fixed
in the parent reference frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>parent</strong> : ReferenceFrame</p>
<blockquote>
<div><p>Reference frame that this reference frame will be rotated relative
to.</p>
</div></blockquote>
<p><strong>axis</strong> : Vector</p>
<blockquote>
<div><p>Vector fixed in the parent frame about about which this frame is
rotated. It need not be a unit vector and the rotation follows the
right hand rule.</p>
</div></blockquote>
<p><strong>angle</strong> : sympifiable</p>
<blockquote>
<div><p>Angle in radians by which it the frame is to be rotated.</p>
</div></blockquote>
</dd>
<dt class="field-even">Warns</dt>
<dd class="field-even"><p><strong>UserWarning</strong></p>
<blockquote>
<div><p>If the orientation creates a kinematic loop.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>Setup variables for the examples:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">q1</span><span class="p">)</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">orient_axis()</span></code> method generates a direction cosine matrix and
its transpose which defines the orientation of B relative to N and vice
versa. Once orient is called, <code class="docutils literal notranslate"><span class="pre">dcm()</span></code> outputs the appropriate
direction cosine matrix:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,       0,      0],</span>
<span class="go">[0,  cos(q1), sin(q1)],</span>
<span class="go">[0, -sin(q1), cos(q1)]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">B</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,       0,        0],</span>
<span class="go">[0, cos(q1), -sin(q1)],</span>
<span class="go">[0, sin(q1),  cos(q1)]])</span>
</pre></div>
</div>
<p>The following two lines show that the sense of the rotation can be
defined by negating the vector direction or the angle. Both lines
produce the same result.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="o">-</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">q1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="n">q1</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.orient_body_fixed">
<span class="sig-name descname"><span class="pre">orient_body_fixed</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">angles</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rotation_order</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L774-L896"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.orient_body_fixed" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotates this reference frame relative to the parent reference frame
by right hand rotating through three successive body fixed simple axis
rotations. Each subsequent axis of rotation is about the “body fixed”
unit vectors of a new intermediate reference frame. This type of
rotation is also referred to rotating through the <a class="reference external" href="https://en.wikipedia.org/wiki/Euler_angles">Euler and Tait-Bryan
Angles</a>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>parent</strong> : ReferenceFrame</p>
<blockquote>
<div><p>Reference frame that this reference frame will be rotated relative
to.</p>
</div></blockquote>
<p><strong>angles</strong> : 3-tuple of sympifiable</p>
<blockquote>
<div><p>Three angles in radians used for the successive rotations.</p>
</div></blockquote>
<p><strong>rotation_order</strong> : 3 character string or 3 digit integer</p>
<blockquote>
<div><p>Order of the rotations about each intermediate reference frames’
unit vectors. The Euler rotation about the X, Z’, X’’ axes can be
specified by the strings <code class="docutils literal notranslate"><span class="pre">'XZX'</span></code>, <code class="docutils literal notranslate"><span class="pre">'131'</span></code>, or the integer
<code class="docutils literal notranslate"><span class="pre">131</span></code>. There are 12 unique valid rotation orders (6 Euler and 6
Tait-Bryan): zxz, xyx, yzy, zyz, xzx, yxy, xyz, yzx, zxy, xzy, zyx,
and yxz.</p>
</div></blockquote>
</dd>
<dt class="field-even">Warns</dt>
<dd class="field-even"><p><strong>UserWarning</strong></p>
<blockquote>
<div><p>If the orientation creates a kinematic loop.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>Setup variables for the examples:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q1, q2, q3&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B2</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B3</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B3&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>For example, a classic Euler Angle rotation can be done by:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_body_fixed</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="p">(</span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span><span class="p">),</span> <span class="s1">&#39;XYX&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[        cos(q2),                            sin(q1)*sin(q2),                           -sin(q2)*cos(q1)],</span>
<span class="go">[sin(q2)*sin(q3), -sin(q1)*sin(q3)*cos(q2) + cos(q1)*cos(q3),  sin(q1)*cos(q3) + sin(q3)*cos(q1)*cos(q2)],</span>
<span class="go">[sin(q2)*cos(q3), -sin(q1)*cos(q2)*cos(q3) - sin(q3)*cos(q1), -sin(q1)*sin(q3) + cos(q1)*cos(q2)*cos(q3)]])</span>
</pre></div>
</div>
<p>This rotates reference frame B relative to reference frame N through
<code class="docutils literal notranslate"><span class="pre">q1</span></code> about <code class="docutils literal notranslate"><span class="pre">N.x</span></code>, then rotates B again through <code class="docutils literal notranslate"><span class="pre">q2</span></code> about
<code class="docutils literal notranslate"><span class="pre">B.y</span></code>, and finally through <code class="docutils literal notranslate"><span class="pre">q3</span></code> about <code class="docutils literal notranslate"><span class="pre">B.x</span></code>. It is equivalent to
three successive <code class="docutils literal notranslate"><span class="pre">orient_axis()</span></code> calls:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">q1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B2</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">B1</span><span class="p">,</span> <span class="n">B1</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">q2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B3</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">B2</span><span class="p">,</span> <span class="n">B2</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">q3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B3</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[        cos(q2),                            sin(q1)*sin(q2),                           -sin(q2)*cos(q1)],</span>
<span class="go">[sin(q2)*sin(q3), -sin(q1)*sin(q3)*cos(q2) + cos(q1)*cos(q3),  sin(q1)*cos(q3) + sin(q3)*cos(q1)*cos(q2)],</span>
<span class="go">[sin(q2)*cos(q3), -sin(q1)*cos(q2)*cos(q3) - sin(q3)*cos(q1), -sin(q1)*sin(q3) + cos(q1)*cos(q2)*cos(q3)]])</span>
</pre></div>
</div>
<p>Acceptable rotation orders are of length 3, expressed in as a string
<code class="docutils literal notranslate"><span class="pre">'XYZ'</span></code> or <code class="docutils literal notranslate"><span class="pre">'123'</span></code> or integer <code class="docutils literal notranslate"><span class="pre">123</span></code>. Rotations about an axis
twice in a row are prohibited.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_body_fixed</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="p">(</span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="s1">&#39;ZXZ&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_body_fixed</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="p">(</span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="s1">&#39;121&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_body_fixed</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="p">(</span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span><span class="p">),</span> <span class="mi">123</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.orient_explicit">
<span class="sig-name descname"><span class="pre">orient_explicit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dcm</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L676-L757"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.orient_explicit" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the orientation of this reference frame relative to a parent
reference frame by explicitly setting the direction cosine matrix.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>parent</strong> : ReferenceFrame</p>
<blockquote>
<div><p>Reference frame that this reference frame will be rotated relative
to.</p>
</div></blockquote>
<p><strong>dcm</strong> : Matrix, shape(3, 3)</p>
<blockquote>
<div><p>Direction cosine matrix that specifies the relative rotation
between the two reference frames.</p>
</div></blockquote>
</dd>
<dt class="field-even">Warns</dt>
<dd class="field-even"><p><strong>UserWarning</strong></p>
<blockquote>
<div><p>If the orientation creates a kinematic loop.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>Setup variables for the examples:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">Matrix</span><span class="p">,</span> <span class="n">sin</span><span class="p">,</span> <span class="n">cos</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>A simple rotation of <code class="docutils literal notranslate"><span class="pre">A</span></code> relative to <code class="docutils literal notranslate"><span class="pre">N</span></code> about <code class="docutils literal notranslate"><span class="pre">N.x</span></code> is defined
by the following direction cosine matrix:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">dcm</span> <span class="o">=</span> <span class="n">Matrix</span><span class="p">([[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span>
<span class="gp">... </span>              <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="n">cos</span><span class="p">(</span><span class="n">q1</span><span class="p">),</span> <span class="o">-</span><span class="n">sin</span><span class="p">(</span><span class="n">q1</span><span class="p">)],</span>
<span class="gp">... </span>              <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="n">sin</span><span class="p">(</span><span class="n">q1</span><span class="p">),</span> <span class="n">cos</span><span class="p">(</span><span class="n">q1</span><span class="p">)]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">orient_explicit</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">dcm</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,       0,      0],</span>
<span class="go">[0,  cos(q1), sin(q1)],</span>
<span class="go">[0, -sin(q1), cos(q1)]])</span>
</pre></div>
</div>
<p>This is equivalent to using <code class="docutils literal notranslate"><span class="pre">orient_axis()</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">q1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,       0,      0],</span>
<span class="go">[0,  cos(q1), sin(q1)],</span>
<span class="go">[0, -sin(q1), cos(q1)]])</span>
</pre></div>
</div>
<p><strong>Note carefully that</strong> <code class="docutils literal notranslate"><span class="pre">N.dcm(B)</span></code> <strong>(the transpose) would be passed
into</strong> <code class="docutils literal notranslate"><span class="pre">orient_explicit()</span></code> <strong>for</strong> <code class="docutils literal notranslate"><span class="pre">A.dcm(N)</span></code> <strong>to match</strong>
<code class="docutils literal notranslate"><span class="pre">B.dcm(N)</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">orient_explicit</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">B</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,       0,      0],</span>
<span class="go">[0,  cos(q1), sin(q1)],</span>
<span class="go">[0, -sin(q1), cos(q1)]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.orient_quaternion">
<span class="sig-name descname"><span class="pre">orient_quaternion</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">numbers</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L1020-L1111"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.orient_quaternion" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the orientation of this reference frame relative to a parent
reference frame via an orientation quaternion. An orientation
quaternion is defined as a finite rotation a unit vector, <code class="docutils literal notranslate"><span class="pre">(lambda_x,</span>
<span class="pre">lambda_y,</span> <span class="pre">lambda_z)</span></code>, by an angle <code class="docutils literal notranslate"><span class="pre">theta</span></code>. The orientation
quaternion is described by four parameters:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">q0</span> <span class="pre">=</span> <span class="pre">cos(theta/2)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">q1</span> <span class="pre">=</span> <span class="pre">lambda_x*sin(theta/2)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">q2</span> <span class="pre">=</span> <span class="pre">lambda_y*sin(theta/2)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">q3</span> <span class="pre">=</span> <span class="pre">lambda_z*sin(theta/2)</span></code></p></li>
</ul>
<p>See <a class="reference external" href="https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation">Quaternions and Spatial Rotation</a> on
Wikipedia for more information.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>parent</strong> : ReferenceFrame</p>
<blockquote>
<div><p>Reference frame that this reference frame will be rotated relative
to.</p>
</div></blockquote>
<p><strong>numbers</strong> : 4-tuple of sympifiable</p>
<blockquote>
<div><p>The four quaternion scalar numbers as defined above: <code class="docutils literal notranslate"><span class="pre">q0</span></code>,
<code class="docutils literal notranslate"><span class="pre">q1</span></code>, <code class="docutils literal notranslate"><span class="pre">q2</span></code>, <code class="docutils literal notranslate"><span class="pre">q3</span></code>.</p>
</div></blockquote>
</dd>
<dt class="field-even">Warns</dt>
<dd class="field-even"><p><strong>UserWarning</strong></p>
<blockquote>
<div><p>If the orientation creates a kinematic loop.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>Setup variables for the examples:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q0</span><span class="p">,</span> <span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q0 q1 q2 q3&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>Set the orientation:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_quaternion</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="p">(</span><span class="n">q0</span><span class="p">,</span> <span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[q0**2 + q1**2 - q2**2 - q3**2,             2*q0*q3 + 2*q1*q2,            -2*q0*q2 + 2*q1*q3],</span>
<span class="go">[           -2*q0*q3 + 2*q1*q2, q0**2 - q1**2 + q2**2 - q3**2,             2*q0*q1 + 2*q2*q3],</span>
<span class="go">[            2*q0*q2 + 2*q1*q3,            -2*q0*q1 + 2*q2*q3, q0**2 - q1**2 - q2**2 + q3**2]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.orient_space_fixed">
<span class="sig-name descname"><span class="pre">orient_space_fixed</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">angles</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rotation_order</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L898-L1018"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.orient_space_fixed" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotates this reference frame relative to the parent reference frame
by right hand rotating through three successive space fixed simple axis
rotations. Each subsequent axis of rotation is about the “space fixed”
unit vectors of the parent reference frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>parent</strong> : ReferenceFrame</p>
<blockquote>
<div><p>Reference frame that this reference frame will be rotated relative
to.</p>
</div></blockquote>
<p><strong>angles</strong> : 3-tuple of sympifiable</p>
<blockquote>
<div><p>Three angles in radians used for the successive rotations.</p>
</div></blockquote>
<p><strong>rotation_order</strong> : 3 character string or 3 digit integer</p>
<blockquote>
<div><p>Order of the rotations about the parent reference frame’s unit
vectors. The order can be specified by the strings <code class="docutils literal notranslate"><span class="pre">'XZX'</span></code>,
<code class="docutils literal notranslate"><span class="pre">'131'</span></code>, or the integer <code class="docutils literal notranslate"><span class="pre">131</span></code>. There are 12 unique valid
rotation orders.</p>
</div></blockquote>
</dd>
<dt class="field-even">Warns</dt>
<dd class="field-even"><p><strong>UserWarning</strong></p>
<blockquote>
<div><p>If the orientation creates a kinematic loop.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>Setup variables for the examples:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q1, q2, q3&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B2</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B3</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B3&#39;</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_space_fixed</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="p">(</span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span><span class="p">),</span> <span class="s1">&#39;312&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[ sin(q1)*sin(q2)*sin(q3) + cos(q1)*cos(q3), sin(q1)*cos(q2), sin(q1)*sin(q2)*cos(q3) - sin(q3)*cos(q1)],</span>
<span class="go">[-sin(q1)*cos(q3) + sin(q2)*sin(q3)*cos(q1), cos(q1)*cos(q2), sin(q1)*sin(q3) + sin(q2)*cos(q1)*cos(q3)],</span>
<span class="go">[                           sin(q3)*cos(q2),        -sin(q2),                           cos(q2)*cos(q3)]])</span>
</pre></div>
</div>
<p>is equivalent to:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">z</span><span class="p">,</span> <span class="n">q1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B2</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">B1</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">q2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B3</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">B2</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">q3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B3</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span><span class="o">.</span><span class="n">simplify</span><span class="p">()</span>
<span class="go">Matrix([</span>
<span class="go">[ sin(q1)*sin(q2)*sin(q3) + cos(q1)*cos(q3), sin(q1)*cos(q2), sin(q1)*sin(q2)*cos(q3) - sin(q3)*cos(q1)],</span>
<span class="go">[-sin(q1)*cos(q3) + sin(q2)*sin(q3)*cos(q1), cos(q1)*cos(q2), sin(q1)*sin(q3) + sin(q2)*cos(q1)*cos(q3)],</span>
<span class="go">[                           sin(q3)*cos(q2),        -sin(q2),                           cos(q2)*cos(q3)]])</span>
</pre></div>
</div>
<p>It is worth noting that space-fixed and body-fixed rotations are
related by the order of the rotations, i.e. the reverse order of body
fixed will give space fixed and vice versa.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_space_fixed</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="p">(</span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span><span class="p">),</span> <span class="s1">&#39;231&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[cos(q1)*cos(q2), sin(q1)*sin(q3) + sin(q2)*cos(q1)*cos(q3), -sin(q1)*cos(q3) + sin(q2)*sin(q3)*cos(q1)],</span>
<span class="go">[       -sin(q2),                           cos(q2)*cos(q3),                            sin(q3)*cos(q2)],</span>
<span class="go">[sin(q1)*cos(q2), sin(q1)*sin(q2)*cos(q3) - sin(q3)*cos(q1),  sin(q1)*sin(q2)*sin(q3) + cos(q1)*cos(q3)]])</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">orient_body_fixed</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="p">(</span><span class="n">q3</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q1</span><span class="p">),</span> <span class="s1">&#39;132&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[cos(q1)*cos(q2), sin(q1)*sin(q3) + sin(q2)*cos(q1)*cos(q3), -sin(q1)*cos(q3) + sin(q2)*sin(q3)*cos(q1)],</span>
<span class="go">[       -sin(q2),                           cos(q2)*cos(q3),                            sin(q3)*cos(q2)],</span>
<span class="go">[sin(q1)*cos(q2), sin(q1)*sin(q2)*cos(q3) - sin(q3)*cos(q1),  sin(q1)*sin(q2)*sin(q3) + cos(q1)*cos(q3)]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.orientnew">
<span class="sig-name descname"><span class="pre">orientnew</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">newname</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rot_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">amounts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rot_order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variables</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indices</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">latexs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L1193-L1303"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.orientnew" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a new reference frame oriented with respect to this
reference frame.</p>
<p>See <code class="docutils literal notranslate"><span class="pre">ReferenceFrame.orient()</span></code> for detailed examples of how to orient
reference frames.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>newname</strong> : str</p>
<blockquote>
<div><p>Name for the new reference frame.</p>
</div></blockquote>
<p><strong>rot_type</strong> : str</p>
<blockquote>
<div><p>The method used to generate the direction cosine matrix. Supported
methods are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">'Axis'</span></code>: simple rotations about a single common axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'DCM'</span></code>: for setting the direction cosine matrix directly</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Body'</span></code>: three successive rotations about new intermediate
axes, also called “Euler and Tait-Bryan angles”</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Space'</span></code>: three successive rotations about the parent
frames’ unit vectors</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Quaternion'</span></code>: rotations defined by four parameters which
result in a singularity free direction cosine matrix</p></li>
</ul>
</div></blockquote>
<p><strong>amounts :</strong></p>
<blockquote>
<div><p>Expressions defining the rotation angles or direction cosine
matrix. These must match the <code class="docutils literal notranslate"><span class="pre">rot_type</span></code>. See examples below for
details. The input types are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">'Axis'</span></code>: 2-tuple (expr/sym/func, Vector)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'DCM'</span></code>: Matrix, shape(3,3)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Body'</span></code>: 3-tuple of expressions, symbols, or functions</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Space'</span></code>: 3-tuple of expressions, symbols, or functions</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">'Quaternion'</span></code>: 4-tuple of expressions, symbols, or
functions</p></li>
</ul>
</div></blockquote>
<p><strong>rot_order</strong> : str or int, optional</p>
<blockquote>
<div><p>If applicable, the order of the successive of rotations. The string
<code class="docutils literal notranslate"><span class="pre">'123'</span></code> and integer <code class="docutils literal notranslate"><span class="pre">123</span></code> are equivalent, for example. Required
for <code class="docutils literal notranslate"><span class="pre">'Body'</span></code> and <code class="docutils literal notranslate"><span class="pre">'Space'</span></code>.</p>
</div></blockquote>
<p><strong>indices</strong> : tuple of str</p>
<blockquote>
<div><p>Enables the reference frame’s basis unit vectors to be accessed by
Python’s square bracket indexing notation using the provided three
indice strings and alters the printing of the unit vectors to
reflect this choice.</p>
</div></blockquote>
<p><strong>latexs</strong> : tuple of str</p>
<blockquote>
<div><p>Alters the LaTeX printing of the reference frame’s basis unit
vectors to the provided three valid LaTeX strings.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">vlatex</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q0</span><span class="p">,</span> <span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q0 q1 q2 q3&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>Create a new reference frame A rotated relative to N through a simple
rotation.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">(</span><span class="n">q0</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">))</span>
</pre></div>
</div>
<p>Create a new reference frame B rotated relative to N through body-fixed
rotations.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">,</span> <span class="s1">&#39;Body&#39;</span><span class="p">,</span> <span class="p">(</span><span class="n">q1</span><span class="p">,</span> <span class="n">q2</span><span class="p">,</span> <span class="n">q3</span><span class="p">),</span> <span class="s1">&#39;123&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>Create a new reference frame C rotated relative to N through a simple
rotation with unique indices and LaTeX printing.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">C</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;C&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">(</span><span class="n">q0</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">),</span> <span class="n">indices</span><span class="o">=</span><span class="p">(</span><span class="s1">&#39;1&#39;</span><span class="p">,</span> <span class="s1">&#39;2&#39;</span><span class="p">,</span> <span class="s1">&#39;3&#39;</span><span class="p">),</span>
<span class="gp">... </span><span class="n">latexs</span><span class="o">=</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;\hat{\mathbf</span><span class="si">{c}</span><span class="s1">}_1&#39;</span><span class="p">,</span><span class="sa">r</span><span class="s1">&#39;\hat{\mathbf</span><span class="si">{c}</span><span class="s1">}_2&#39;</span><span class="p">,</span>
<span class="gp">... </span><span class="sa">r</span><span class="s1">&#39;\hat{\mathbf</span><span class="si">{c}</span><span class="s1">}_3&#39;</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span><span class="p">[</span><span class="s1">&#39;1&#39;</span><span class="p">]</span>
<span class="go">C[&#39;1&#39;]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">vlatex</span><span class="p">(</span><span class="n">C</span><span class="p">[</span><span class="s1">&#39;1&#39;</span><span class="p">]))</span>
<span class="go">\hat{\mathbf{c}}_1</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.partial_velocity">
<span class="sig-name descname"><span class="pre">partial_velocity</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">frame</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gen_speeds</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L1392-L1430"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.partial_velocity" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the partial angular velocities of this frame in the given
frame with respect to one or more provided generalized speeds.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The frame with which the angular velocity is defined in.</p>
</div></blockquote>
<p><strong>gen_speeds</strong> : functions of time</p>
<blockquote>
<div><p>The generalized speeds.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>partial_velocities</strong> : tuple of Vector</p>
<blockquote>
<div><p>The partial angular velocity vectors corresponding to the provided
generalized speeds.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">u1</span><span class="p">,</span> <span class="n">u2</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;u1, u2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">set_ang_vel</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">u1</span> <span class="o">*</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">u2</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">partial_velocity</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">u1</span><span class="p">)</span>
<span class="go">A.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">partial_velocity</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">u1</span><span class="p">,</span> <span class="n">u2</span><span class="p">)</span>
<span class="go">(A.x, N.y)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.set_ang_acc">
<span class="sig-name descname"><span class="pre">set_ang_acc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">otherframe</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L1305-L1339"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.set_ang_acc" title="Permalink to this definition">¶</a></dt>
<dd><p>Define the angular acceleration Vector in a ReferenceFrame.</p>
<p>Defines the angular acceleration of this ReferenceFrame, in another.
Angular acceleration can be defined with respect to multiple different
ReferenceFrames. Care must be taken to not create loops which are
inconsistent.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>otherframe</strong> : ReferenceFrame</p>
<blockquote>
<div><p>A ReferenceFrame to define the angular acceleration in</p>
</div></blockquote>
<p><strong>value</strong> : Vector</p>
<blockquote>
<div><p>The Vector representing angular acceleration</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">V</span> <span class="o">=</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">set_ang_acc</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">V</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">ang_acc_in</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">10*N.x</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.set_ang_vel">
<span class="sig-name descname"><span class="pre">set_ang_vel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">otherframe</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L1341-L1375"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.set_ang_vel" title="Permalink to this definition">¶</a></dt>
<dd><p>Define the angular velocity vector in a ReferenceFrame.</p>
<p>Defines the angular velocity of this ReferenceFrame, in another.
Angular velocity can be defined with respect to multiple different
ReferenceFrames. Care must be taken to not create loops which are
inconsistent.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>otherframe</strong> : ReferenceFrame</p>
<blockquote>
<div><p>A ReferenceFrame to define the angular velocity in</p>
</div></blockquote>
<p><strong>value</strong> : Vector</p>
<blockquote>
<div><p>The Vector representing angular velocity</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">V</span> <span class="o">=</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">set_ang_vel</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">V</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">10*N.x</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.variable_map">
<span class="sig-name descname"><span class="pre">variable_map</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">otherframe</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/frame.py#L337-L377"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.variable_map" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary which expresses the coordinate variables
of this frame in terms of the variables of otherframe.</p>
<p>If Vector.simp is True, returns a simplified version of the mapped
values. Else, returns them without simplification.</p>
<p>Simplification of the expressions may take time.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>otherframe</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The other frame to map the variables to</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">A</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">[</span><span class="n">q</span><span class="p">,</span> <span class="n">A</span><span class="o">.</span><span class="n">z</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">variable_map</span><span class="p">(</span><span class="n">B</span><span class="p">)</span>
<span class="go">{A_x: B_x*cos(q(t)) - B_y*sin(q(t)), A_y: B_x*sin(q(t)) + B_y*cos(q(t)), A_z: B_z}</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.x">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">x</span></span><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.x" title="Permalink to this definition">¶</a></dt>
<dd><p>The basis Vector for the ReferenceFrame, in the x direction.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.y">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">y</span></span><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.y" title="Permalink to this definition">¶</a></dt>
<dd><p>The basis Vector for the ReferenceFrame, in the y direction.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.vector.frame.ReferenceFrame.z">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">z</span></span><a class="headerlink" href="#sympy.physics.vector.frame.ReferenceFrame.z" title="Permalink to this definition">¶</a></dt>
<dd><p>The basis Vector for the ReferenceFrame, in the z direction.</p>
</dd></dl>

</dd></dl>

</section>
<section id="vector">
<h2>Vector<a class="headerlink" href="#vector" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.vector.</span></span><span class="sig-name descname"><span class="pre">Vector</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inlist</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L11-L813"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector" title="Permalink to this definition">¶</a></dt>
<dd><p>The class used to define vectors.</p>
<p>It along with ReferenceFrame are the building blocks of describing a
classical mechanics system in PyDy and sympy.physics.vector.</p>
<p class="rubric">Attributes</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 6%" />
<col style="width: 94%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p>simp</p></td>
<td><p>(Boolean) Let certain methods use trigsimp on their outputs</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.angle_between">
<span class="sig-name descname"><span class="pre">angle_between</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vec</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L708-L745"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.angle_between" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the smallest angle between Vector ‘vec’ and self.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Python ignores the leading negative sign so that might
give wrong results.
<code class="docutils literal notranslate"><span class="pre">-A.x.angle_between()</span></code> would be treated as <code class="docutils literal notranslate"><span class="pre">-(A.x.angle_between())</span></code>,
instead of <code class="docutils literal notranslate"><span class="pre">(-A.x).angle_between()</span></code>.</p>
</div>
<p class="rubric">Parameter</p>
<dl class="simple">
<dt>vec<span class="classifier">Vector</span></dt><dd><p>The Vector between which angle is needed.</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s2">&quot;A&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v1</span> <span class="o">=</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v2</span> <span class="o">=</span> <span class="n">A</span><span class="o">.</span><span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v1</span><span class="o">.</span><span class="n">angle_between</span><span class="p">(</span><span class="n">v2</span><span class="p">)</span>
<span class="go">pi/2</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">v3</span> <span class="o">=</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">A</span><span class="o">.</span><span class="n">y</span> <span class="o">+</span> <span class="n">A</span><span class="o">.</span><span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v1</span><span class="o">.</span><span class="n">angle_between</span><span class="p">(</span><span class="n">v3</span><span class="p">)</span>
<span class="go">acos(sqrt(3)/3)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.applyfunc">
<span class="sig-name descname"><span class="pre">applyfunc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L698-L706"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.applyfunc" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply a function to each component of a vector.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.cross">
<span class="sig-name descname"><span class="pre">cross</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L482-L483"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.cross" title="Permalink to this definition">¶</a></dt>
<dd><p>The cross product operator for two Vectors.</p>
<p>Returns a Vector, expressed in the same ReferenceFrames as self.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>other</strong> : Vector</p>
<blockquote>
<div><p>The Vector which we are crossing with</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span><span class="o">.</span><span class="n">x</span> <span class="o">^</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span>
<span class="go">N.z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">[</span><span class="n">q1</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">x</span> <span class="o">^</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span>
<span class="go">N.z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span><span class="o">.</span><span class="n">y</span> <span class="o">^</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span>
<span class="go">- sin(q1)*A.y - cos(q1)*A.z</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.diff">
<span class="sig-name descname"><span class="pre">diff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">var</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">var_in_dcm</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L490-L555"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.diff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the partial derivative of the vector with respect to a
variable in the provided reference frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>var</strong> : Symbol</p>
<blockquote>
<div><p>What the partial derivative is taken with respect to.</p>
</div></blockquote>
<p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The reference frame that the partial derivative is taken in.</p>
</div></blockquote>
<p><strong>var_in_dcm</strong> : boolean</p>
<blockquote>
<div><p>If true, the differentiation algorithm assumes that the variable
may be present in any of the direction cosine matrices that relate
the frame to the frames of any component of the vector. But if it
is known that the variable is not present in the direction cosine
matrices, false can be set to skip full reexpression in the desired
frame.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">dynamicsymbols</span><span class="p">,</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">Vector</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">init_vprinting</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">init_vprinting</span><span class="p">(</span><span class="n">pretty_print</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Vector</span><span class="o">.</span><span class="n">simp</span> <span class="o">=</span> <span class="kc">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;t&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;q1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">[</span><span class="n">q1</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">x</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="n">N</span><span class="p">)</span>
<span class="go">- q1&#39;*A.z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">u1</span><span class="p">,</span> <span class="n">u2</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;u1, u2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v</span> <span class="o">=</span> <span class="n">u1</span> <span class="o">*</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">u2</span> <span class="o">*</span> <span class="n">B</span><span class="o">.</span><span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">u2</span><span class="p">,</span> <span class="n">N</span><span class="p">,</span> <span class="n">var_in_dcm</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">B.y</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L628-L633"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Calls .doit() on each term in the Vector</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.dot">
<span class="sig-name descname"><span class="pre">dot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L478-L479"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.dot" title="Permalink to this definition">¶</a></dt>
<dd><p>Dot product of two vectors.</p>
<p>Returns a scalar, the dot product of the two Vectors</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>other</strong> : Vector</p>
<blockquote>
<div><p>The Vector which we are dotting with</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">dot</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">dot</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">dot</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">[</span><span class="n">q1</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">dot</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">A</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="go">cos(q1)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.dt">
<span class="sig-name descname"><span class="pre">dt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">otherframe</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L635-L650"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.dt" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a Vector which is the time derivative of
the self Vector, taken in frame otherframe.</p>
<p>Calls the global time_derivative method</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>otherframe</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The frame to calculate the time derivative in</p>
</div></blockquote>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.express">
<span class="sig-name descname"><span class="pre">express</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">otherframe</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variables</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L557-L586"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.express" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a Vector equivalent to this one, expressed in otherframe.
Uses the global express method.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>otherframe</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The frame for this Vector to be described in</p>
</div></blockquote>
<p><strong>variables</strong> : boolean</p>
<blockquote>
<div><p>If True, the coordinate symbols(if present) in this Vector
are re-expressed in terms otherframe</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">init_vprinting</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">init_vprinting</span><span class="p">(</span><span class="n">pretty_print</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q1</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;q1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">[</span><span class="n">q1</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">x</span><span class="o">.</span><span class="n">express</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">cos(q1)*N.x - sin(q1)*N.z</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.free_symbols">
<span class="sig-name descname"><span class="pre">free_symbols</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">reference_frame</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L747-L761"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.free_symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the free symbols in the measure numbers of the vector
expressed in the given reference frame.</p>
<p class="rubric">Parameter</p>
<dl class="simple">
<dt>reference_frame<span class="classifier">ReferenceFrame</span></dt><dd><p>The frame with respect to which the free symbols of the
given vector is to be determined.</p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.func">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">func</span></span><a class="headerlink" href="#sympy.physics.vector.vector.Vector.func" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the class Vector.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.magnitude">
<span class="sig-name descname"><span class="pre">magnitude</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L680-L692"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.magnitude" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the magnitude (Euclidean norm) of self.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Python ignores the leading negative sign so that might
give wrong results.
<code class="docutils literal notranslate"><span class="pre">-A.x.magnitude()</span></code> would be treated as <code class="docutils literal notranslate"><span class="pre">-(A.x.magnitude())</span></code>,
instead of <code class="docutils literal notranslate"><span class="pre">(-A.x).magnitude()</span></code>.</p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.normalize">
<span class="sig-name descname"><span class="pre">normalize</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L694-L696"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.normalize" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a Vector of magnitude 1, codirectional with self.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.outer">
<span class="sig-name descname"><span class="pre">outer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L486-L487"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.outer" title="Permalink to this definition">¶</a></dt>
<dd><p>Outer product between two Vectors.</p>
<p>A rank increasing operation, which returns a Dyadic from two Vectors</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>other</strong> : Vector</p>
<blockquote>
<div><p>The Vector to take the outer product with</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">outer</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">outer</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="go">(N.x|N.x)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.separate">
<span class="sig-name descname"><span class="pre">separate</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L453-L476"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.separate" title="Permalink to this definition">¶</a></dt>
<dd><p>The constituents of this vector in different reference frames,
as per its definition.</p>
<p>Returns a dict mapping each ReferenceFrame to the corresponding
constituent Vector.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R1</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R2</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v</span> <span class="o">=</span> <span class="n">R1</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">R2</span><span class="o">.</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v</span><span class="o">.</span><span class="n">separate</span><span class="p">()</span> <span class="o">==</span> <span class="p">{</span><span class="n">R1</span><span class="p">:</span> <span class="n">R1</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">R2</span><span class="p">:</span> <span class="n">R2</span><span class="o">.</span><span class="n">x</span><span class="p">}</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.simplify">
<span class="sig-name descname"><span class="pre">simplify</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L652-L657"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.simplify" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a simplified Vector.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.subs">
<span class="sig-name descname"><span class="pre">subs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L659-L678"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.subs" title="Permalink to this definition">¶</a></dt>
<dd><p>Substitution on the Vector.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;s&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span> <span class="o">*</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="o">.</span><span class="n">subs</span><span class="p">({</span><span class="n">s</span><span class="p">:</span> <span class="mi">2</span><span class="p">})</span>
<span class="go">2*N.x</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.to_matrix">
<span class="sig-name descname"><span class="pre">to_matrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">reference_frame</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L588-L626"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.to_matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the matrix form of the vector with respect to the given
frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>reference_frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The reference frame that the rows of the matrix correspond to.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>matrix</strong> : ImmutableMatrix, shape(3,1)</p>
<blockquote>
<div><p>The matrix that gives the 1D vector.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;a, b, c&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">vector</span> <span class="o">=</span> <span class="n">a</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">b</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span> <span class="o">+</span> <span class="n">c</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">vector</span><span class="o">.</span><span class="n">to_matrix</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[a],</span>
<span class="go">[b],</span>
<span class="go">[c]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">beta</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;beta&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">(</span><span class="n">beta</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">vector</span><span class="o">.</span><span class="n">to_matrix</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[                         a],</span>
<span class="go">[ b*cos(beta) + c*sin(beta)],</span>
<span class="go">[-b*sin(beta) + c*cos(beta)]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.vector.Vector.xreplace">
<span class="sig-name descname"><span class="pre">xreplace</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rule</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/vector.py#L771-L813"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.vector.Vector.xreplace" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace occurrences of objects within the measure numbers of the vector.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>rule</strong> : dict-like</p>
<blockquote>
<div><p>Expresses a replacement rule.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Vector</p>
<blockquote>
<div><p>Result of the replacement.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x y z&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span> <span class="o">*</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">xreplace</span><span class="p">({</span><span class="n">x</span><span class="p">:</span> <span class="n">pi</span><span class="p">})</span>
<span class="go">(pi*y + 1)*A.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span> <span class="o">*</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">xreplace</span><span class="p">({</span><span class="n">x</span><span class="p">:</span> <span class="n">pi</span><span class="p">,</span> <span class="n">y</span><span class="p">:</span> <span class="mi">2</span><span class="p">})</span>
<span class="go">(1 + 2*pi)*A.x</span>
</pre></div>
</div>
<p>Replacements occur only if an entire node in the expression tree is
matched:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">z</span><span class="p">)</span> <span class="o">*</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">xreplace</span><span class="p">({</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">:</span> <span class="n">pi</span><span class="p">})</span>
<span class="go">(z + pi)*A.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="o">*</span><span class="n">z</span><span class="p">)</span> <span class="o">*</span> <span class="n">A</span><span class="o">.</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">xreplace</span><span class="p">({</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">:</span> <span class="n">pi</span><span class="p">})</span>
<span class="go">x*y*z*A.x</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

</section>
<section id="dyadic">
<h2>Dyadic<a class="headerlink" href="#dyadic" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.dyadic.</span></span><span class="sig-name descname"><span class="pre">Dyadic</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inlist</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L8-L586"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic" title="Permalink to this definition">¶</a></dt>
<dd><p>A Dyadic object.</p>
<p>See:
<a class="reference external" href="https://en.wikipedia.org/wiki/Dyadic_tensor">https://en.wikipedia.org/wiki/Dyadic_tensor</a>
Kane, T., Levinson, D. Dynamics Theory and Applications. 1985 McGraw-Hill</p>
<p>A more powerful way to represent a rigid body’s inertia. While it is more
complex, by choosing Dyadic components to be in body fixed basis vectors,
the resulting matrix is equivalent to the inertia tensor.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.applyfunc">
<span class="sig-name descname"><span class="pre">applyfunc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L519-L527"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.applyfunc" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply a function to each component of a Dyadic.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.cross">
<span class="sig-name descname"><span class="pre">cross</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L345-L370"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.cross" title="Permalink to this definition">¶</a></dt>
<dd><p>For a cross product in the form: Dyadic x Vector.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>other</strong> : Vector</p>
<blockquote>
<div><p>The Vector that we are crossing this Dyadic with</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">outer</span><span class="p">,</span> <span class="n">cross</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span> <span class="o">=</span> <span class="n">outer</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cross</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="go">(N.x|N.z)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L460-L463"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Calls .doit() on each term in the Dyadic</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.dot">
<span class="sig-name descname"><span class="pre">dot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L71-L105"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.dot" title="Permalink to this definition">¶</a></dt>
<dd><p>The inner product operator for a Dyadic and a Dyadic or Vector.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>other</strong> : Dyadic or Vector</p>
<blockquote>
<div><p>The other Dyadic or Vector to take the inner product with</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">outer</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">D1</span> <span class="o">=</span> <span class="n">outer</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">D2</span> <span class="o">=</span> <span class="n">outer</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">D1</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">D2</span><span class="p">)</span>
<span class="go">(N.x|N.y)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">D1</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="go">N.x</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.dt">
<span class="sig-name descname"><span class="pre">dt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">frame</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L465-L491"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.dt" title="Permalink to this definition">¶</a></dt>
<dd><p>Take the time derivative of this Dyadic in a frame.</p>
<p>This function calls the global time_derivative method</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The frame to take the time derivative in</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">outer</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">init_vprinting</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">init_vprinting</span><span class="p">(</span><span class="n">pretty_print</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">[</span><span class="n">q</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">z</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span> <span class="o">=</span> <span class="n">outer</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span><span class="o">.</span><span class="n">dt</span><span class="p">(</span><span class="n">B</span><span class="p">)</span>
<span class="go">- q&#39;*(N.y|N.x) - q&#39;*(N.x|N.y)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.express">
<span class="sig-name descname"><span class="pre">express</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">frame1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame2</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L375-L408"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.express" title="Permalink to this definition">¶</a></dt>
<dd><p>Expresses this Dyadic in alternate frame(s)</p>
<p>The first frame is the list side expression, the second frame is the
right side; if Dyadic is in form A.x|B.y, you can express it in two
different frames. If no second frame is given, the Dyadic is
expressed in only one frame.</p>
<p>Calls the global express function</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>frame1</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The frame to express the left side of the Dyadic in</p>
</div></blockquote>
<p><strong>frame2</strong> : ReferenceFrame</p>
<blockquote>
<div><p>If provided, the frame to express the right side of the Dyadic in</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">outer</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">init_vprinting</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">init_vprinting</span><span class="p">(</span><span class="n">pretty_print</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">[</span><span class="n">q</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">z</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span> <span class="o">=</span> <span class="n">outer</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span><span class="o">.</span><span class="n">express</span><span class="p">(</span><span class="n">B</span><span class="p">,</span> <span class="n">N</span><span class="p">)</span>
<span class="go">cos(q)*(B.x|N.x) - sin(q)*(B.y|N.x)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.func">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">func</span></span><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.func" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the class Dyadic.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.simplify">
<span class="sig-name descname"><span class="pre">simplify</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L493-L498"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.simplify" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a simplified Dyadic.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.subs">
<span class="sig-name descname"><span class="pre">subs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L500-L517"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.subs" title="Permalink to this definition">¶</a></dt>
<dd><p>Substitution on the Dyadic.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;s&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">s</span><span class="o">*</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="o">|</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="o">.</span><span class="n">subs</span><span class="p">({</span><span class="n">s</span><span class="p">:</span> <span class="mi">2</span><span class="p">})</span>
<span class="go">2*(N.x|N.x)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.to_matrix">
<span class="sig-name descname"><span class="pre">to_matrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">reference_frame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">second_reference_frame</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L410-L458"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.to_matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the matrix form of the dyadic with respect to one or two
reference frames.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>reference_frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The reference frame that the rows and columns of the matrix
correspond to. If a second reference frame is provided, this
only corresponds to the rows of the matrix.</p>
</div></blockquote>
<p><strong>second_reference_frame</strong> : ReferenceFrame, optional, default=None</p>
<blockquote>
<div><p>The reference frame that the columns of the matrix correspond
to.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>matrix</strong> : ImmutableMatrix, shape(3,3)</p>
<blockquote>
<div><p>The matrix that gives the 2D tensor form.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">Vector</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Vector</span><span class="o">.</span><span class="n">simp</span> <span class="o">=</span> <span class="kc">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">inertia</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ixx</span><span class="p">,</span> <span class="n">Iyy</span><span class="p">,</span> <span class="n">Izz</span><span class="p">,</span> <span class="n">Ixy</span><span class="p">,</span> <span class="n">Iyz</span><span class="p">,</span> <span class="n">Ixz</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;Ixx, Iyy, Izz, Ixy, Iyz, Ixz&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inertia_dyadic</span> <span class="o">=</span> <span class="n">inertia</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">Ixx</span><span class="p">,</span> <span class="n">Iyy</span><span class="p">,</span> <span class="n">Izz</span><span class="p">,</span> <span class="n">Ixy</span><span class="p">,</span> <span class="n">Iyz</span><span class="p">,</span> <span class="n">Ixz</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inertia_dyadic</span><span class="o">.</span><span class="n">to_matrix</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[Ixx, Ixy, Ixz],</span>
<span class="go">[Ixy, Iyy, Iyz],</span>
<span class="go">[Ixz, Iyz, Izz]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">beta</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;beta&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">N</span><span class="o">.</span><span class="n">orientnew</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="s1">&#39;Axis&#39;</span><span class="p">,</span> <span class="p">(</span><span class="n">beta</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inertia_dyadic</span><span class="o">.</span><span class="n">to_matrix</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[                           Ixx,                                           Ixy*cos(beta) + Ixz*sin(beta),                                           -Ixy*sin(beta) + Ixz*cos(beta)],</span>
<span class="go">[ Ixy*cos(beta) + Ixz*sin(beta), Iyy*cos(2*beta)/2 + Iyy/2 + Iyz*sin(2*beta) - Izz*cos(2*beta)/2 + Izz/2,                 -Iyy*sin(2*beta)/2 + Iyz*cos(2*beta) + Izz*sin(2*beta)/2],</span>
<span class="go">[-Ixy*sin(beta) + Ixz*cos(beta),                -Iyy*sin(2*beta)/2 + Iyz*cos(2*beta) + Izz*sin(2*beta)/2, -Iyy*cos(2*beta)/2 + Iyy/2 - Iyz*sin(2*beta) + Izz*cos(2*beta)/2 + Izz/2]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.vector.dyadic.Dyadic.xreplace">
<span class="sig-name descname"><span class="pre">xreplace</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rule</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/dyadic.py#L542-L586"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.dyadic.Dyadic.xreplace" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace occurrences of objects within the measure numbers of the Dyadic.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>rule</strong> : dict-like</p>
<blockquote>
<div><p>Expresses a replacement rule.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Dyadic</p>
<blockquote>
<div><p>Result of the replacement.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">outer</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">D</span> <span class="o">=</span> <span class="n">outer</span><span class="p">(</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x y z&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span> <span class="o">*</span> <span class="n">D</span><span class="p">)</span><span class="o">.</span><span class="n">xreplace</span><span class="p">({</span><span class="n">x</span><span class="p">:</span> <span class="n">pi</span><span class="p">})</span>
<span class="go">(pi*y + 1)*(N.x|N.x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span> <span class="o">*</span> <span class="n">D</span><span class="p">)</span><span class="o">.</span><span class="n">xreplace</span><span class="p">({</span><span class="n">x</span><span class="p">:</span> <span class="n">pi</span><span class="p">,</span> <span class="n">y</span><span class="p">:</span> <span class="mi">2</span><span class="p">})</span>
<span class="go">(1 + 2*pi)*(N.x|N.x)</span>
</pre></div>
</div>
<p>Replacements occur only if an entire node in the expression tree is
matched:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">z</span><span class="p">)</span> <span class="o">*</span> <span class="n">D</span><span class="p">)</span><span class="o">.</span><span class="n">xreplace</span><span class="p">({</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">:</span> <span class="n">pi</span><span class="p">})</span>
<span class="go">(z + pi)*(N.x|N.x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="o">*</span><span class="n">z</span><span class="p">)</span> <span class="o">*</span> <span class="n">D</span><span class="p">)</span><span class="o">.</span><span class="n">xreplace</span><span class="p">({</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">:</span> <span class="n">pi</span><span class="p">})</span>
<span class="go">x*y*z*(N.x|N.x)</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../../index.html">
              <img class="logo" src="../../../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Essential Classes</a><ul>
<li><a class="reference internal" href="#coordinatesym">CoordinateSym</a></li>
<li><a class="reference internal" href="#referenceframe">ReferenceFrame</a></li>
<li><a class="reference internal" href="#vector">Vector</a></li>
<li><a class="reference internal" href="#dyadic">Dyadic</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="../fields.html"
                        title="previous chapter">Scalar and Vector Field Functionality</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="kinematics.html"
                        title="next chapter">Kinematics (Docstrings)</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../../_sources/modules/physics/vector/api/classes.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="kinematics.html" title="Kinematics (Docstrings)"
             >next</a> |</li>
        <li class="right" >
          <a href="../fields.html" title="Scalar and Vector Field Functionality"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="../index.html" >The Physics Vector Module</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Essential Classes</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/physics/vector/api/classes.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:31 GMT -->
</html>